Optimal. Leaf size=130 \[ -\frac {2 a^2 (5 A-7 i B)}{15 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 a^2 (B+i A)}{d \sqrt {\cot (c+d x)}}+\frac {4 \sqrt [4]{-1} a^2 (A-i B) \tanh ^{-1}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}+\frac {2 i B \left (a^2 \cot (c+d x)+i a^2\right )}{5 d \cot ^{\frac {5}{2}}(c+d x)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3581, 3593, 3591, 3529, 3533, 208} \[ -\frac {2 a^2 (5 A-7 i B)}{15 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 a^2 (B+i A)}{d \sqrt {\cot (c+d x)}}+\frac {4 \sqrt [4]{-1} a^2 (A-i B) \tanh ^{-1}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}+\frac {2 i B \left (a^2 \cot (c+d x)+i a^2\right )}{5 d \cot ^{\frac {5}{2}}(c+d x)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 3529
Rule 3533
Rule 3581
Rule 3591
Rule 3593
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (c+d x))^2 (A+B \tan (c+d x))}{\sqrt {\cot (c+d x)}} \, dx &=\int \frac {(i a+a \cot (c+d x))^2 (B+A \cot (c+d x))}{\cot ^{\frac {7}{2}}(c+d x)} \, dx\\ &=\frac {2 i B \left (i a^2+a^2 \cot (c+d x)\right )}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {2}{5} \int \frac {(i a+a \cot (c+d x)) \left (\frac {1}{2} a (5 i A+7 B)+\frac {1}{2} a (5 A-3 i B) \cot (c+d x)\right )}{\cot ^{\frac {5}{2}}(c+d x)} \, dx\\ &=-\frac {2 a^2 (5 A-7 i B)}{15 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {2 i B \left (i a^2+a^2 \cot (c+d x)\right )}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {2}{5} \int \frac {5 a^2 (i A+B)+5 a^2 (A-i B) \cot (c+d x)}{\cot ^{\frac {3}{2}}(c+d x)} \, dx\\ &=-\frac {2 a^2 (5 A-7 i B)}{15 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 a^2 (i A+B)}{d \sqrt {\cot (c+d x)}}+\frac {2 i B \left (i a^2+a^2 \cot (c+d x)\right )}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {2}{5} \int \frac {5 a^2 (A-i B)-5 a^2 (i A+B) \cot (c+d x)}{\sqrt {\cot (c+d x)}} \, dx\\ &=-\frac {2 a^2 (5 A-7 i B)}{15 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 a^2 (i A+B)}{d \sqrt {\cot (c+d x)}}+\frac {2 i B \left (i a^2+a^2 \cot (c+d x)\right )}{5 d \cot ^{\frac {5}{2}}(c+d x)}+\frac {\left (20 a^4 (A-i B)^2\right ) \operatorname {Subst}\left (\int \frac {1}{-5 a^2 (A-i B)-5 a^2 (i A+B) x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{d}\\ &=\frac {4 \sqrt [4]{-1} a^2 (A-i B) \tanh ^{-1}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}-\frac {2 a^2 (5 A-7 i B)}{15 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 a^2 (i A+B)}{d \sqrt {\cot (c+d x)}}+\frac {2 i B \left (i a^2+a^2 \cot (c+d x)\right )}{5 d \cot ^{\frac {5}{2}}(c+d x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 7.78, size = 133, normalized size = 1.02 \[ \frac {a^2 \left (\sec ^2(c+d x) (-5 (A-2 i B) \sin (2 (c+d x))+(33 B+30 i A) \cos (2 (c+d x))+30 i A+27 B)-\frac {60 i (A-i B) \tanh ^{-1}\left (\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}\right )}{\sqrt {i \tan (c+d x)}}\right )}{15 d \sqrt {\cot (c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.55, size = 503, normalized size = 3.87 \[ -\frac {15 \, \sqrt {\frac {{\left (16 i \, A^{2} + 32 \, A B - 16 i \, B^{2}\right )} a^{4}}{d^{2}}} {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (-\frac {{\left (4 \, {\left (A - i \, B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - \sqrt {\frac {{\left (16 i \, A^{2} + 32 \, A B - 16 i \, B^{2}\right )} a^{4}}{d^{2}}} {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (2 i \, A + 2 \, B\right )} a^{2}}\right ) - 15 \, \sqrt {\frac {{\left (16 i \, A^{2} + 32 \, A B - 16 i \, B^{2}\right )} a^{4}}{d^{2}}} {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (-\frac {{\left (4 \, {\left (A - i \, B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - \sqrt {\frac {{\left (16 i \, A^{2} + 32 \, A B - 16 i \, B^{2}\right )} a^{4}}{d^{2}}} {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (2 i \, A + 2 \, B\right )} a^{2}}\right ) - 8 \, {\left ({\left (35 \, A - 43 i \, B\right )} a^{2} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (25 \, A - 11 i \, B\right )} a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} - {\left (35 \, A - 31 i \, B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - {\left (25 \, A - 23 i \, B\right )} a^{2}\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}}{60 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{2}}{\sqrt {\cot \left (d x + c\right )}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 1.77, size = 971, normalized size = 7.47 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.71, size = 200, normalized size = 1.54 \[ -\frac {4 \, {\left (3 \, B a^{2} + \frac {5 \, {\left (A - 2 i \, B\right )} a^{2}}{\tan \left (d x + c\right )} + \frac {{\left (-30 i \, A - 30 \, B\right )} a^{2}}{\tan \left (d x + c\right )^{2}}\right )} \tan \left (d x + c\right )^{\frac {5}{2}} + 15 \, {\left (2 \, \sqrt {2} {\left (-\left (i - 1\right ) \, A - \left (i + 1\right ) \, B\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) + 2 \, \sqrt {2} {\left (-\left (i - 1\right ) \, A - \left (i + 1\right ) \, B\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) - \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right ) + \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (-\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right )\right )} a^{2}}{30 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^2}{\sqrt {\mathrm {cot}\left (c+d\,x\right )}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ - a^{2} \left (\int \left (- \frac {A}{\sqrt {\cot {\left (c + d x \right )}}}\right )\, dx + \int \frac {A \tan ^{2}{\left (c + d x \right )}}{\sqrt {\cot {\left (c + d x \right )}}}\, dx + \int \left (- \frac {B \tan {\left (c + d x \right )}}{\sqrt {\cot {\left (c + d x \right )}}}\right )\, dx + \int \frac {B \tan ^{3}{\left (c + d x \right )}}{\sqrt {\cot {\left (c + d x \right )}}}\, dx + \int \left (- \frac {2 i A \tan {\left (c + d x \right )}}{\sqrt {\cot {\left (c + d x \right )}}}\right )\, dx + \int \left (- \frac {2 i B \tan ^{2}{\left (c + d x \right )}}{\sqrt {\cot {\left (c + d x \right )}}}\right )\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________